package com.my.study.algorithm.linked;

/**
 * @author Carlos
 * @version 1.0
 * @Description 链表节点
 * @date 2021/10/26 7:40
 **/
public class ListNode {

    int val;
    ListNode next = null;

    public ListNode() {
    }

    public ListNode(int val) {
        this.val = val;
    }

    public ListNode(int val, ListNode next) {
        this.val = val;
        this.next = next;
    }

    public int getVal() {
        return val;
    }

    public ListNode getNext() {
        return next;
    }

    @Override
    public String toString() {
        return "ListNode{" +
                "val=" + val +
                ", next=" + next +
                '}';
    }
}
